﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FatCatSniffer
{
    public static class Extensions
    {
        public static void PrintErrorToConsole(this Exception ex)
        {
            object lockObj = new object();

            lock (lockObj)
            {
                ConsoleColor prevColor = Console.ForegroundColor;

                Console.ForegroundColor = ConsoleColor.Red;

                Console.WriteLine("Error: {0}", ex.Message);
                Console.WriteLine("StackTrace: {0}", ex.StackTrace);

                Console.ForegroundColor = prevColor;
            }
        }
    }
}
